package com.appheader.webfragmentviewpagertest.viewholder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;

import com.appheader.webfragmentviewpagertest.R;
import com.appheader.webfragmentviewpagertest.listener.OnRecyclerViewItemClickListener;

/**
 * Created by zhep on 2016/9/28.
 */
public class VerticalItemViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    public ImageView imageView;

    private OnRecyclerViewItemClickListener listener;

    public VerticalItemViewHolder(View itemView, OnRecyclerViewItemClickListener listener) {
        super(itemView);
//        imageView = (ImageView) itemView.findViewById(R.id.img);
        imageView = (ImageView) itemView.findViewById(R.id.img);
        this.listener = listener;
//        itemView.setOnClickListener(this);//item的点击监听
    }
    @Override
    public void onClick(View v) {
        if (listener != null) {
            listener.onItemClick(v, getPosition());
        }
    }
}
